package com.spudtech.graphics
{
    
    import flash.geom.*;
    import flash.display.*;
    
    import flash.utils.Dictionary;
    
    import com.spudtech.*;
    import com.spudtech.tween.*;
    
    
    public class SpudAnimation
    {
        protected var _tweens : Dictionary;
        
        public function SpudAnimation(tweens : Dictionary)
        {
            _tweens = tweens;
        }
        
        
        public function get tweens() : Dictionary
        {
            return _tweens;
        }
        
        
        public function getTween(bone_name : String) : SpudTween
        {
            // TODO - Return a SpudPathTween instead
            
            if (tweens[bone_name] == null)
            {
                throw new ReferenceError("Invalid bone name given (No tweens for that bone)");
            }
            
            return tweens[bone_name];
            
        }
        
        public function updateBones(bone_names : Array) : void
        {
            for each (var name : String in bone_names)
            {
                // If the name is invalid,
                // this will throw an
                // exception, which is
                // what we want
                getTween(name).update();
                
            }
        }
        
    }
    
}
